package com.obas.event {

   import flash.events.Event;

   [Response(name="{RETURN_ID}", type="com.ease.framework.CommandCompletionEvent")]
   public class RequestExplorerEvent extends Event {

      public static const REQUEST_ID:String = "RequestExplorerEvent_Request";
      public static const RETURN_ID:String = "RequestExplorerEvent_Return";

      public static const TYPE_GET_ROOT:String = "getRoot";
      public static const TYPE_GET_CHILDREN_EXP:String = "getChildExplorers";
      public static const TYPE_GET_CHILDREN_ENTITY:String = "getChildEntities";
      public static const TYPE_GET_ENTITY_MENU:String = "getEntityMenu";
      public static const TYPE_GET_ACTION:String = "getAction";

      private var _reqNode:*;
      private var _spec:Object;
      private var _actionType:String;
      public function RequestExplorerEvent(
                                           spec:Object,
                                           reqNode:* = null,
                                           actionType:String = TYPE_GET_ROOT,
                                           type:String = null) {
         var typeId:String = type;
         if (type == null) {
            typeId = REQUEST_ID;
         }
         super(typeId);
         _reqNode = reqNode;
         _spec = spec;
         _actionType = actionType;
      }

      public override function clone():Event {
         var event:RequestExplorerEvent = new RequestExplorerEvent(spec, reqNode, actionType, type);
         return event;
      }

      public function get spec():Object {
         return _spec;
      }

      public function get actionType():String {
         return _actionType;
      }

      public function get reqNode():* {
         return _reqNode;
      }
   }
}